// 待办事项优先级
export enum TodoPriority {
  LOW = 'low',
  MEDIUM = 'medium',
  HIGH = 'high',
  URGENT = 'urgent'
}

// 待办事项状态
export enum TodoStatus {
  TODO = 'todo',
  IN_PROGRESS = 'in_progress',
  COMPLETED = 'completed',
  CANCELLED = 'cancelled'
}

// 待办事项分类
export interface TodoCategory {
  id: string
  name: string
  description?: string
  type: string
  color?: string
  sortNo: number
  parentId?: string
  children?: TodoCategory[]
  isLeaf?: boolean
}

// 待办事项
export interface TodoItem {
  id: string
  title: string
  content?: string
  status: TodoStatus
  priority: TodoPriority
  categoryId?: string
  categoryName?: string
  category?: TodoCategory
  tags?: string[]
  dueDate?: string
  createdTime: string
  completedAt?: string
  isTop?: boolean
  isFavorite?: boolean
}

// 创建待办事项请求
export interface CreateTodoRequest {
  title?: string
  content?: string
  priority: TodoPriority
  categoryId?: string
  tags?: string[]
  dueDate?: string
}

// 更新待办事项请求
export interface UpdateTodoRequest {
  title?: string
  content?: string
  status?: TodoStatus
  priority?: TodoPriority
  categoryId?: string
  tags?: string[]
  dueDate?: string
  isTop?: boolean
  isFavorite?: boolean
}

// 待办事项过滤器
export interface TodoFilter {
  status?: TodoStatus[]
  priority?: TodoPriority[]
  categoryId?: string | -1
  tags?: string[]
  dueDateFrom?: string
  dueDateTo?: string
  keyword?: string
  isFavorite?: boolean
}

// 待办事项排序
export interface TodoSort {
  field: 'createdAt' | 'updatedAt' | 'dueDate' | 'priority' | 'title'
  order: 'asc' | 'desc'
}